Skip to content

fix(typing): User may not have provided a return annotation for an overload #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bzoracler
Copy link

If the source code doesn't provide a return type annotation on one or more overloads, then 1-indexed value of the inner tuple, representing the annotation, can be None.

This is a consequence of the following:

grouped["overloads"].append(
(child_data["args"], child_data["return_annotation"])
)

"return_annotation": _astroid_utils.get_return_annotation(node),

def get_return_annotation(node: astroid.nodes.FunctionDef) -> str | None:

@AWhetter
Copy link
Collaborator

@bzoracler Thanks for making this change! Please could you fix the failing tests. It looks like you need to add release notes (see https://github.com/readthedocs/sphinx-autoapi?tab=readme-ov-file#release-notes).

@bzoracler
Copy link
Author

@AWhetter Thank you for pointing me to that, could you enable the workflow again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants